package com.ruoyi.system.service.city.impl;

import java.util.List;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.system.domain.city.CityCarousel;
import com.ruoyi.system.mapper.city.CityCarouselMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.city.CityCollectMapper;
import com.ruoyi.system.domain.city.CityCollect;
import com.ruoyi.system.service.city.ICityCollectService;

/**
 * 收藏Service业务层处理
 * 
 * @author cjq
 * @date 2023-07-29
 */
@Service
public class CityCollectServiceImpl  implements ICityCollectService
{
    @Autowired
    private CityCollectMapper cityCollectMapper;

    /**
     * 查询收藏
     * 
     * @param collectId 收藏主键
     * @return 收藏
     */
    @Override
    public CityCollect selectCityCollectByCollectId(Long collectId)
    {
        return cityCollectMapper.selectCityCollectByCollectId(collectId);
    }

    /**
     * 查询收藏列表
     * 
     * @param cityCollect 收藏
     * @return 收藏
     */
    @Override
    public List<CityCollect> selectCityCollectList(CityCollect cityCollect)
    {
        return cityCollectMapper.selectCityCollectList(cityCollect);
    }

    /**
     * 新增收藏
     * 
     * @param cityCollect 收藏
     * @return 结果
     */
    @Override
    public int insertCityCollect(CityCollect cityCollect)
    {
        cityCollect.setCreateTime(DateUtils.getNowDate());
        return cityCollectMapper.insertCityCollect(cityCollect);
    }

    /**
     * 修改收藏
     * 
     * @param cityCollect 收藏
     * @return 结果
     */
    @Override
    public int updateCityCollect(CityCollect cityCollect)
    {
        return cityCollectMapper.updateCityCollect(cityCollect);
    }

    /**
     * 批量删除收藏
     * 
     * @param collectIds 需要删除的收藏主键
     * @return 结果
     */
    @Override
    public int deleteCityCollectByCollectIds(Long[] collectIds)
    {
        return cityCollectMapper.deleteCityCollectByCollectIds(collectIds);
    }

    /**
     * 删除收藏信息
     * 
     * @param projectId 项目主键
     * @return 结果
     */
    @Override
    public int deleteCityCollectByCollectId(Long projectId)
    {
        return cityCollectMapper.deleteCityCollectByCollectId(projectId);
    }
}
